package main

import "sort"

//#link: https://leetcode-cn.com/problems/h-index-ii/
func main() {

}

func hIndex(citations []int) (h int) {
	n := len(citations)
	return n - sort.Search(n, func(x int) bool { return citations[x] >= n-x })
}
